
	<div class="block">

<div id= 'content'>
	<h2>用户管理</h2>
	<table class="contentTable" border="1">
			<tbody><tr class="solid">
		<td>帐号</td>
		<td>基本信息</td>
		<td>帐户信息</td>
		<td>操作</td>

		</tr>
	
	
		<?php
		foreach($allUsers as $user){
		?>
		<tr>
		<td><?php echo $user->id;?></td>
		<td>	
	<ul>
		<li>真实姓名：<?php echo $user->real_name;?></li>
		<li>邮箱：<?php echo $user->email;?></li>
		<li>电话号码：<?php echo $user->phone_number;?></li>
		<li>工作地址：<?php echo $user->work_address;?></li>
	</ul>
	    </td>
		<td>
	<ul>
		<li>用户名：<?php echo $user->name;?></li>
		<li>权限：<?php echo $user->getAuthorityName();?></li>
		<li>职位：<?php echo $user->position;?></li>

		
	</ul>
	</td>
	
	
	<td>
			 <form action="api/" method="post">
        	<input type="hidden" id='action' name="action" value="delete_user" />
            <input type="hidden" id='id' name="id" value=<?php echo $user->id;?> />

	
	<?php 
	if($user->id==$currentUser->id){
	?>
	<input type="submit" value="删除" style="float:left" disabled/><div class="important">自身帐号不可删除</div>

	<?php 
	}elseif($user->authrized('management')){
	?>
		<input type="submit" value="删除" style="float:left" disabled/><div class="important">此账户为管理员 管理员帐号不可被删除</div>

	<?php
	}else{
	?>
<input type="submit" value="删除"/>
<?php
	}
?>
          </form>
          
          
          <form action="index.php" method="GET">
          	            <input type="hidden" id='id' name="id" value=<?php echo $user->id;?> />
          	            <input type="hidden" id='page' name="page" value='alter_user'/>
	
	<?php 
	if($user->id==$currentUser->id){
	?>
	<input type="submit" value="更改" style="float:left" disabled/><div class="important">请到“帐户详情”更改</div>

	<?php 
	}elseif($user->authrized('management')){
	?>
		<input type="submit" value="更改" style="float:left" disabled/><div class="important">此账户为管理员 权限不可被修改</div>

	<?php
	}else{
	?>
<input type="submit" value="更改"/>
<?php
	}
?>

</form>
		</td>
		
		</tr>

	
	<?php
		}
	?>
		</tbody></table>
<br>
<br>
<br>
<div class="done" style="display:none;">
<b>操作成功</b>
<a href="?page=current_user">返回</a>
</div>

    <div class="form">
    	<b>添加用户</b>
        <form action="api/" method="post">
        	<input type="hidden" id='action' name="action" value="add_user" />
    <div class="element">
        <label class="form">用户名(字母和数字)</label>
 
        <input type="text" id="name" name="name" class="text" value='' ><p class='important'>*必须</p>
    </div> 
    <div class="element" style="clear:both;">
        <label class="form">权限</label>
        
        <div class='checkbox'>
    <input type="radio" name="autority" value="pick" checked="checked">自选<br>
    <div>
    <?php
    foreach($allOrganizations as $organization){
    		$organization->name;
	?>
	    <input type="checkbox" name="pick[]" value="<?php echo $organization->id;?>"><?php echo $organization->name;?><br>
		
	<?php	
    }
    ?>
        <input type="checkbox" name="pick[]" value="management">管理<br>
	    <input type="checkbox" name="pick[]" value="accounting">财务／会计<br>

    </div>
    <input type="radio" name="autority" value="full">全部<br>
    <input type="radio" name="autority" value="none">无权限
     </div>

    </div>
    <div class="element">
        <label class="form">职位（任意）</label>
        <input type="text" id="position" name="position" class="text" value='' >
    </div>
    <div class="element">
        <label class="form">密码（字母和数字）</label>
        <input type="text" id="password" name="password" class="text" value='1111' disabled>
    </div>
    <div class="element">
        <label class="form">真实姓名（中文）</label>
 
        <input type="text" id="real_name" name="real_name" class="text" value='' >
    </div>
    <div class="element">
        <label class="form">邮箱</label>
 
        <input type="text" id="email" name="email" class="text" value='' >
    </div>
    <div class="element">
        <label class="form">电话号码（数字）</label>
 
        <input type="text" id="phone_number" name="phone_number" class="text" value='' >
    </div>
    <div class="element">
        <label class="form">工作地址</label>
 
        <input type="text" id="work_address" name="work_address" class="text" value='' >
    </div>

 

    <div class="element">
<input type="submit" value="递交" />
        <div class="loading"></div>
    </div>
    </form>
    </div>
    </div>
<div class="clear"></div>
	</div>